package IO流.IO流操作.节点流.inputStream和outputStream.输出流;

import java.io.*;

public class Test011 {
    /**
     * 文件字节输出流
     * 1.创建源
     * 2.选择流
     * 3.操作
     * 4.释放资源
     */
    public static void main(String[] args) {
        //1.创建源
        File file = new File("haha.txt");
        //2.选择流
        OutputStream o = null;
        try {
          o = new FileOutputStream(file,true);
            byte[] a = "857".getBytes();
            o.write(a);
            o.flush();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e){
            e.printStackTrace();
        }finally {
            //4.释放资源
            try {
                if (o != null) {
                    o.close();

                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }



    }
}
